package com.example.boxuegu.DengZhu;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.widget.TextView;

import com.example.boxuegu.MainActivity;
import com.example.boxuegu.R;

import java.util.Timer;
import java.util.TimerTask;

public class MyZhuJiMian extends AppCompatActivity {

    private TextView text;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_zhu_ji_mian);
        init();
    }


    private void init() {
        text = findViewById(R.id.textView);
        try {
            PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);

            text.setText("V."+packageInfo.versionName);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
            text.setText("V");

        }
        //延时页面跳转
        Timer timer = new Timer();
        TimerTask timerTask = new TimerTask(){
            @Override
            public void run() {
                Intent intent = new Intent(MyZhuJiMian.this, MainActivity.class);
                startActivity(intent);
                MyZhuJiMian.this.finish();
            }
        };
        timer.schedule(timerTask,2000);

    }

}